package com.kgis.map.geometry {
    import com.kgis.map.Map;
    import com.kgis.map.common.enum.GeoTypeEnum;
    import com.kgis.map.geometry.basetype.Extent;
    import com.kgis.map.style.IStyle;
    import flash.display.Sprite;
    import com.kgis.map.geometry.AbstractGeometry;
    import com.kgis.map.geometry.IAreaGeometry;
    import com.kgis.map.geometry.PointGeometry;

    [Bindable]
    [RemoteClass(alias="com.kgis.map.model.geometry.EllipseGeometry")]
    /**
     * 椭圆几何体
     */
    public class EllipseGeometry extends AbstractGeometry implements IAreaGeometry {
        /**左上叫坐标*/
        public var topLeftPoint:PointGeometry;

        /**宽度*/
        public var width:Number;

        /**高度*/
        public var height:Number;

        public function EllipseGeometry() {
            super();
        }

        /**
         * 绘制几何体
         */
        override public function draw(sprite:Sprite, geoStyle:IStyle, map:Map):void {
            return;
        }

        override public function getExtent():Extent {
            return super.getExtent();
        }

        override public function getGeometryType():int {
            return GeoTypeEnum.ELLIPSEGEOMETRY;
        }

        /**
         * 得到几何体范围
         */
        public function calculateBounds():void {
        /*		    if(this.geoExtent == null)
           {
           geoExtent = new Bounds(0,0,0,0);
           geoExtent.right = -999999999;
           geoExtent.left = 999999999;
           geoExtent.top = -999999999;
           geoExtent.bottom = 999999999;
           if(geoExtent.right < (this.topLeftPoint.x+this.width))
           {
           geoExtent.right = this.topLeftPoint.x+this.width;
           }
           if(geoExtent.left > this.topLeftPoint.x)
           {
           geoExtent.left = this.topLeftPoint.x;
           }
           if(geoExtent.top <this.topLeftPoint.y)
           {
           geoExtent.top = this.topLeftPoint.y;
           }
           if(geoExtent.bottom > (this.topLeftPoint.y-this.height))
           {
           geoExtent.bottom = this.topLeftPoint.y-this.height;
           }
           }
         return geoExtent;*/
        }
    }
}